<?php require_once('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"L-6");
// -- get customer

// get area
mysql_select_db($database_con_gl, $con_gl);
$query_area = "select id, area from gl_area where id = '$_SESSION[area]'";
$area = mysql_query($query_area, $con_gl) or die(mysql_error());
$row_area = mysql_fetch_assoc($area);

// get name lokasi 
mysql_select_db($database_con_gl, $con_gl);
$query_lokasi = "select id, gudang from gl_gudang where id = '$_SESSION[lokasi]'";
$lokasi = mysql_query($query_lokasi, $con_gl) or die(mysql_error());
$row_lokasi = mysql_fetch_assoc($lokasi);



mysql_select_db($database_con_gl, $con_gl);
$query_kontak = "SELECT id, nama, type, tcustomer, status, email FROM gl_kontak where gl_kontak.type ='Customer' AND status='AKTIF' ORDER BY type, nama ASC";
$kontak = mysql_query($query_kontak, $con_gl) or die(mysql_error());
$row_kontak = mysql_fetch_assoc($kontak);
$totalRows_kontak = mysql_num_rows($kontak);
// get paket
mysql_select_db($database_con_gl, $con_gl);
$query_kelom = "SELECT id, kelompok FROM gl_kelompok where jual=1 AND jenis=2 ORDER BY kelompok desc";
$kelom = mysql_query($query_kelom, $con_gl) or die(mysql_error());
$row_kelom = mysql_fetch_assoc($kelom);
$totalRows_kelom = mysql_num_rows($kelom);
// --- lokasi kantor
mysql_select_db($database_con_gl, $con_gl);
$query_gudang = "SELECT * FROM gl_gudang where id='$_SESSION[lokasi]'";
$gudang = mysql_query($query_gudang, $con_gl) or die(mysql_error());
$row_gudang = mysql_fetch_assoc($gudang);
$totalRows_gudang = mysql_num_rows($gudang);

// default akun
//mysql_select_db($database_con_gl, $con_gl);
//$query_def_ak = "SELECT gl_gudang.a_piu, gl_gudang.a_kas, gl_gudang.a_beb, gl_gudang.a_paj FROM gl_gudang";
//$def_ak = mysql_query($query_def_ak, $con_gl) or die(mysql_error());
//$row_def_ak = mysql_fetch_assoc($def_ak);
//$totalRows_def_ak = mysql_num_rows($def_ak);
// salesman
mysql_select_db($database_con_gl, $con_gl);
$query_salesmen = "SELECT gl_kontak.id, gl_kontak.nama FROM gl_kontak WHERE gl_kontak.type='Karyawan' AND gl_kontak.tkaryawan='Sales' AND area = '$_SESSION[area]' order by nama";
$salesmen = mysql_query($query_salesmen, $con_gl) or die(mysql_error());
$row_salesmen = mysql_fetch_assoc($salesmen);
$totalRows_salesmen = mysql_num_rows($salesmen);
?>
<link href="ccss/ui.datepicker.css" type="text/css" rel="stylesheet" />
<style>
#cusinfo tr td {
	font-size:10px;	
}
</style>
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript">
<!--
$(function()
      {
        $('.calendar').datepicker({
            appendText : "",
            dateFormat : 'yy/mm/dd'
          });
      });
	  
</script>
<script type="text/javascript" src="js/ajax_data.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#add').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
});

</script>
<!-- JAVASRIPT FUNCTION -->
<script type="text/javascript">
function kalkulasiWaktuSewa()
{
 kirimRequest('include/cek_tanggal.php', 'pickupdate='+document.getElementById('checkin').value+'&dropoffdate='+document.getElementById('checkout').value+'&pickuptime='+document.getElementById('waktucheckin').value+'&dropofftime='+document.getElementById('waktucheckout').value+'&type=day', 'jumlah', '');


}
function bbm()
{
/**
this.msg();
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; **/


}
function tol(){
javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}
function parkir()
{
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value
}
function feeDriver()
{
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}
function akomodasi() {
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value
}
function other()
{
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value
}
function msg(){
alert('grandtotal');
}
</script>

<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Tambah Transaksi Order Retail </h1>
<div id="divDetail"><table width="100%" border="0" cellspacing="0" cellpadding="4" class="datatable" id="cusinfo">
  <tr>
    <th colspan="4" align="center">INFORMASI PELANGGAN</th>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;"><div align="left">INFO PEMESAN </div></td>
    <td width="37%" valign="top" style="background:#FFF;">&nbsp;</td>
    <td width="16%" valign="top" style="background:#FFF;">INFO PENJAMIN </td>
    <td width="31%" valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">NPWP :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td width="16%" align="right" valign="top" style="background:#FFF;">Nama :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td width="16%" align="right" valign="top" style="background:#FFF;">Nama :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td align="right" valign="top" style="background:#FFF;">Alamat :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">Alamat :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td align="right" valign="top" style="background:#FFF;">No. Tlp :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">No. Tlp :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td align="right" valign="top" style="background:#FFF;">Jabatan : </td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">Email :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">Keterangan :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
</table>
</div>
<form action="proses/sretail.php?act=add" method="POST" name="add" id="add" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="datatable">
    <tr>
      <th colspan="2">Tanggal Reservasi </th>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <th colspan="3">Rincian Biaya Sewa Kendaraan </th>
    </tr>
    <tr>
      <td width="15%" align="right" valign="top" bgcolor="#FFFFFF">No Order *: </td>
      <td width="38%" valign="top" bgcolor="#FFFFFF"><div id="refDiv">
        <label>
          <input name="noreferensi" type="text" id="noreferensi" value="SJ<?php echo time();?>" size="31" maxlength="31" onchange="cekReferensi(this.value);"/>
        </label>
      </div></td>
      <td width="1%" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top"> Diskon 
        <label>
        <input name="diskon" type="text" id="diskon" onkeyup="javascript: if(this.value=='') this.value='0'; this.value=parseFloat(this.value); var harga=document.getElementById('xharga').value;
document.getElementById('hargasatuan').value=harga - (harga * (this.value/100)); document.getElementById('txtdiskon').value=harga*this.value/100;		document.getElementById('hargaafterppn').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('ppn').value/100); 
document.getElementById('hargaafterpph').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('pph').value/100); 
var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal; " value="0" size="2" maxlength="2" />
%</label>&nbsp;<input type="text" name="txtdiskon" id="txtdiskon" value="0" size="10" onkeyup="javascript: if(this.value=='') this.value='0'; this.value=parseFloat(this.value); var harga=document.getElementById('xharga').value; document.getElementById('diskon').value=100*(parseInt(this.value)/harga); document.getElementById('hargasatuan').value=parseInt(harga) - parseFloat(this.value); document.getElementById('hargaafterppn').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('ppn').value/100); document.getElementById('hargaafterpph').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('pph').value/100); 
var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);;
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" />&nbsp;-&nbsp;Harga Rp.: </td>
      <td width="23%" valign="top" bgcolor="#FFFFFF"><label></label>
      <label id="divHargaKendaraan">
          <input name="hargasatuan" type="text" id="hargasatuan" readonly="readonly" onchange="javascript:this.form.total.value=(this.form.jumlah.value * this.form.hargasatuan.value) - (this.form.jumlah.value * this.form.hargasatuan.value * this.form.diskon.value / 100);" value="0" size="20" maxlength="10" style="text-align:right;" />
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right" valign="top" bgcolor="#FFFFFF">Tanggal Order *: </td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="tanggal" type="text" class="calendar" id="tanggal" value="<?php echo date("Y/m/d");?>" size="12" maxlength="12"/>
      </label>
        &nbsp;JT :
        <label>
          <input name="jatuhtempo" type="text" class="calendar" id="jatuhtempo" value="<?php echo date("Y/m/d"); ?>" size="12" maxlength="12"/>
        </label></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">PPN
        <input name="ppn" type="text" id="ppn" value="10" size="3" maxlength="3" onkeyup="javascript: 		if(this.value=='') {this.value='0'; this.value=parseFloat(this.value); document.getElementById('pph').value='0';}
        else if(this.value=='' || this.value=='0')
        {
           document.getElementById('pph').value='0';
           
        }
        else { document.getElementById('pph').value='2';}
         document.getElementById('hargaafterppn').value=document.getElementById('hargasatuan').value*(this.value/100);
document.getElementById('hargaafterpph').value=document.getElementById('hargasatuan').value*(parseInt(document.getElementById('pph').value)/100); 
var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal; " />
        % - Rp. :</td>
      <td bgcolor="#FFFFFF">
	  <label id="divHargaPPN">
	  <input name="hargaafterppn" type="text" id="hargaafterppn" value="0" size="20" maxlength="100" onfocus="this.blur();" style="text-align:right;"/>
	  </label>	  </td>
    </tr>
    <tr valign="top">
      <td align="right" valign="top" bgcolor="#FFFFFF">Area* :</td>
      <td valign="top" class="datatable">
	  <?php
		if(!strstr($_SESSION[akses],'A-1-4')) {	
		 /* Added by suwondo */
		echo "<input type='hidden' name='area' id='area' value='$_SESSION[area]' />";
		list($namaarea) = mysql_fetch_row(mysql_query("select area from gl_area where id= '$_SESSION[area]'"));
		echo "<input type='text' name='txtarea' id='txtarea' size='28' readonly style='background-color:#fff;border:1px solid #999; height:16px;' value='$namaarea'  />";
		}else{
		?>
	  
	  <!-- Added by suwondo -->
	  <input type="hidden" name="area" id="area" value="<?php echo $row_area['id'] ?>" />
	  <input type="text" name="txtarea" id="txtarea" size="28" value="<?php echo $row_area['area'] ?>" readonly style="background-color:#fff;border:1px solid #999; height:16px;" />
	  <?php if(strstr($_SESSION['akses'],"PD-6-1")) { ?><?php }} ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
		<!-- Added by suwondo --></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">PPh 23
        <input name="pph" type="text" id="pph" value="0" size="3" maxlength="3" readonly="readonly"/>
      %      - Rp. :</td>
      <td bgcolor="#FFFFFF"><input name="hargaafterpph" type="text" readonly="readonly" id="hargaafterpph" value="0" size="20" maxlength="100" onfocus="this.blur();" style="text-align:right;"/></td>
    </tr>
    <tr valign="top">
      <td width="15%" align="right" valign="top" bgcolor="#FFFFFF">Cabang* : </td>
      <td width="38%" valign="top" bgcolor="#FFFFFF">
	  <?php
		if(!strstr($_SESSION[akses],'A-1-4')) {	
		 /* Added by suwondo */
		echo "<input type='hidden' name='gudang' id='cabang' value='$_SESSION[lokasi]' />";
		list($namalokasi) = mysql_fetch_row(mysql_query("select gudang from gl_gudang where id= '$_SESSION[lokasi]'"));
		echo "<input type='text' name='txtcabang' id='txtcabang' size='28' readonly style='background-color:#fff;border:1px solid #999; height:16px;' value='$namalokasi'  />";
		}else{
		?>  
	    <input type="hidden" name="gudang" id="cabang" value="<?php echo $row_lokasi['id'] ?>" />
        <input type="text" name="txtcabang" id="txtcabang" value="<?php echo $row_lokasi['gudang'] ?>" size="28" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;"/>
        <?php if(strstr($_SESSION['akses'],"PD-7-1")) { ?><?php }} ?></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td width="11%" align="right">Biaya Operasional : </td>
      <td width="12%" align="right">BBM Rp.:</td>
      <td bgcolor="#FFFFFF"><label id="divBBM">
        <input name="bbm" type="text" id="bbm" value="0" size="20" maxlength="10";" style="text-align:right;"/>
      </label></td>
    </tr>
    <tr valign="top">
      <td width="15%" align="right" bgcolor="#FFFFFF">Customer *:</td>
      <td width="38%" bgcolor="#FFFFFF"><label></label>
          <!--
		<label id="divKontak">
        <select name="dari" id="dari" onchange="setKeterangan(this.value);getDetailCustomer(this.value); alert(this.value);">
          <option value="" <?php if (!(strcmp("", $row_edit['kontak']))) {echo "selected=\"selected\"";} ?>>Pilih Customer</option>
          <?php
		do {  
		?>
		<option value="<?php echo $row_kontak['id']?>"><?php echo $row_kontak['nama']?></option>
		<?php
		} while ($row_kontak = mysql_fetch_assoc($kontak));
		  $rows = mysql_num_rows($kontak);
		  if($rows > 0) {
			  mysql_data_seek($kontak, 0);
			  $row_kontak = mysql_fetch_assoc($kontak);
		  }
		?>
        </select>
        </label>
		-->
          <!-- Added by suwondo -->
          <input type="hidden" name="dari" id="dari" />
          <input type="text" name="qtxt" id="qtxt" placeholder="Cari Customer ..." size="28" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=kontak&task=listcustomerretail&open=window','name','925','450','yes');return false" />
          <?php 
		  
		  if(strstr($_SESSION['akses'],"DD-2-1")) { ?><?php } ?>
      <label id="divKontak"></label></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">Tol  Rp.: </td>
      <td bgcolor="#FFFFFF"><label id="divTol">
        <input name="tol" type="text" id="tol" value="0" size="20" maxlength="10" onchange="tol()" style="text-align:right;"/>
      </label></td>
    </tr>
	    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Tanggal Pemakaian : </td>
      <td valign="top" bgcolor="#FFFFFF"><label>
       <input name="checkin" type="text" readonly="readonly" class="calendar" id="checkin" value="<?php echo date("Y/m/d");?>" size="12" maxlength="12" onfocus="kalkulasiWaktuSewa();" onchange="kalkulasiWaktuSewa();javascript: this.form.txtbarang.value='';this.form.txtkendaraan.value='';" onclick="kalkulasiWaktuSewa();"/>
        </label>
        - Jam :
  <label>  
   <select id="waktucheckin" name="waktucheckin" onchange="kalkulasiWaktuSewa();javascript: this.form.txtbarang.value='';this.form.txtkendaraan.value='';" >
   	<option value="00:00">00:00</option>
    <option value="00:30">00:30</option>
	<option value="01:00">01:00</option>
	<option value="01:30">01:30</option>
    <option value="02:00">02:00</option>
    <option value="02:30">02:30</option>
    <option value="03:00">03:00</option>
	<option value="03:30">03:30</option>
    <option value="04:00">04:00</option>
    <option value="04:30">04:30</option>
    <option value="05:00">05:00</option>
    <option value="05:30">05:30</option>
    <option value="06:00">06:00</option>
    <option value="06:30">06:30</option>
    <option value="07:00">07:00</option>
    <option value="07:30">07:30</option>
    <option value="08:00">08:00</option>
    <option value="08:30">08:30</option>
    <option value="09:00">09:00</option>
    <option value="09:30">09:30</option>
    <option value="10:00">10:00</option>
    <option value="10:30">10:30</option>
    <option value="11:00">11:00</option>
    <option value="11:30">11:30</option>
    <option value="12:00">12:00</option>
    <option value="12:30">12:30</option>
    <option value="13:00">13:00</option>
    <option value="13:30">13:30</option>
    <option value="14:00">14:00</option>
    <option value="14:30">14:30</option>
    <option value="15:00">15:00</option>
    <option value="15:30">15:30</option>
    <option value="16:00">16:00</option>
    <option value="16:30">16:30</option>
    <option value="17:00">17:00</option>
    <option value="17:30">17:30</option>
    <option value="18:00">18:00</option>
    <option value="18:30">18:30</option>
    <option value="19:00">19:00</option>
    <option value="19:30">19:30</option>
   	<option value="20:00">20:00</option>
    <option value="20:30">20:30</option>
    <option value="21:00">21:00</option>
    <option value="21:30">21:30</option>
    <option value="22:00">22:00</option>
    <option value="22:30">22:30</option>
    <option value="23:00">23:00</option>
    <option value="23:00">23:30</option>  
         
  </select>
</label></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
		<td colspan="2" align="right" valign="top">Parkir Rp.:</td>
		<td valign="top" bgcolor="#FFFFFF"><label id="divParkir"><input name="parkir" type="text" id="parkir" value="0" size="20" maxlength="10" onchange="parkir()" style="text-align:right;"/></label></td>
    </tr>
	<tr>
	  <td align="right" valign="top" bgcolor="#FFFFFF">Tanggal Kembali :</td>
	  <td valign="top" bgcolor="#FFFFFF"><label>
	    <input name="checkout" type="text" readonly="readonly" class="calendar" id="checkout" value="<?php echo date("Y/m/d"); ?>"  size="12" maxlength="12"  onfocus="kalkulasiWaktuSewa();" 
 onchange="kalkulasiWaktuSewa();javascript: this.form.txtbarang.value='';this.form.txtkendaraan.value='';" onclick="kalkulasiWaktuSewa();"/>
	    </label>
	    - Jam :
  <label>
    <select id="waktucheckout" name="waktucheckout" onchange="kalkulasiWaktuSewa();javascript: this.form.txtbarang.value='';this.form.txtkendaraan.value='';" >
   	<option value="00:00">00:00</option>
    <option value="00:30">00:30</option>
	<option value="01:00">01:00</option>
	<option value="01:30">01:30</option>
    <option value="02:00">02:00</option>
    <option value="02:30">02:30</option>
    <option value="03:00">03:00</option>
	<option value="03:30">03:30</option>
    <option value="04:00">04:00</option>
    <option value="04:30">04:30</option>
    <option value="05:00">05:00</option>
    <option value="05:30">05:30</option>
    <option value="06:00">06:00</option>
    <option value="06:30">06:30</option>
    <option value="07:00">07:00</option>
    <option value="07:30">07:30</option>
    <option value="08:00">08:00</option>
    <option value="08:30">08:30</option>
    <option value="09:00">09:00</option>
    <option value="09:30">09:30</option>
    <option value="10:00">10:00</option>
    <option value="10:30">10:30</option>
    <option value="11:00">11:00</option>
    <option value="11:30">11:30</option>
    <option value="12:00">12:00</option>
    <option value="12:30">12:30</option>
    <option value="13:00">13:00</option>
    <option value="13:30">13:30</option>
    <option value="14:00">14:00</option>
    <option value="14:30">14:30</option>
    <option value="15:00">15:00</option>
    <option value="15:30">15:30</option>
    <option value="16:00">16:00</option>
    <option value="16:30">16:30</option>
    <option value="17:00">17:00</option>
    <option value="17:30">17:30</option>
    <option value="18:00">18:00</option>
    <option value="18:30">18:30</option>
    <option value="19:00">19:00</option>
    <option value="19:30">19:30</option>
   	<option value="20:00">20:00</option>
    <option value="20:30">20:30</option>
    <option value="21:00">21:00</option>
    <option value="21:30">21:30</option>
    <option value="22:00">22:00</option>
    <option value="22:30">22:30</option>
    <option value="23:00">23:00</option>
    <option value="23:00">23:30</option>  
         
  </select>
</label></td>
	  <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
		<td colspan="2" align="right" valign="top">Jasa Supir Rp.: </td>
		<td valign="top" bgcolor="#FFFFFF"><label id="divSupir">
	    <input name="supir" type="text" id="supir" value="0" size="20" maxlength="10" onchange="feeDriver()" style="text-align:right;"/></label></td>
	</tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><span id="notif" style="color:blue; background-color: #9999ff;"></span></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Uang Makan Rp.: </td>
      <td valign="top"><label id="divAkomodasi"><input name="akomodasi" type="text" id="akomodasi" readonly="readonly" value="0" size="20" maxlength="10" onchange="akomodasi()" style="text-align:right;"/></label></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Lama Sewa :</td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="jumlah" type="text" id="jumlah" readonly="readonly"         value="0" size="3" maxlength="5" autocomplete="off" />
      </label>
        ( Jlmh Hari ) /
  <input name="jmlhwkt" type="text" readonly="readonly" id="jmlhwkt" value="0" size="3" maxlength="2"   />
        (Jmlh  Jam)
  <div id='loadingjam'></div></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Biaya lain-lain Rp.: </td>
      <td valign="top"><label id="divOther"><input name="other" type="text" id="other" readonly="readonly" value="0" size="20" maxlength="10" onchange="other()" style="text-align:right;"/></label></td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Paket Sewa *: </td>
      <td bgcolor="#FFFFFF">
          <input type="hidden" name="barang" id="barang" />
          <input type="text" name="txtbarang" id="txtbarang" placeholder="Cari Paket Sewa ..." size="30" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=barang&task=list&area='+document.getElementById('area').value+'&jmlhwkt='+document.getElementById('jmlhwkt').value+'&kelompok=<?php echo $row_kelom['id']; ?>&open=window','name','825','450','yes');return false" /></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Kendaraan *: </td>
      <td valign="top" bgcolor="#FFFFFF"><!--
	  <label id="divListKendaraan">
        <select name="kendaraan" id="kendaraan" style="width:180px;">
          <option value="">Pilih Kendaraan</option>
        </select>
      </label>
	  -->
          <!-- Added by suwondo -->
          <input type="hidden" name="kendaraan" id="kendaraan" />
          <input type="text" name="txtkendaraan" id="txtkendaraan" placeholder="Cari Kendaraan ..." size="30" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=kendaraan&task=list&barang='+document.getElementById('barang').value+'&area='+document.getElementById('area').value+'&checkin='+document.getElementById('checkin').value+'&checkout='+document.getElementById('checkout').value+'&jumlah='+document.getElementById('jumlah').value+'&jmlhwkt='+document.getElementById('jmlhwkt').value+'&noref='+document.getElementById('noreferensi').value+'&open=window','name','1200','600','yes');return false" />      </td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <th colspan="2" align="right" valign="top">Total Biaya Ops:</th>
      <td valign="top" bgcolor="#FFFFFF"><input name="biaya" type="text" id="biaya" value="0" size="20" onchange="javascript:this.form.ntotal.value = (2*this.form.xntotal.value) - this.form.xntotal.value + (2*this.form.biaya.value) - this.form.biaya.value + (2*this.form.pajak.value) - this.form.pajak.value;this.form.saldohutang.value=this.form.ntotal.value-this.form.bayar.value;" onfocus="this.blur();" style="text-align:right;"/>
      <input type="hidden" name="xbiaya" id="xbiaya" value=""/></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Kota/Tempat Tujuan:</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="tujuan" type="text" id="tujuan" size="30" maxlength="100" /></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Deposit :</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="deposit" type="hidden" id="deposit" value="0" size="20" maxlength="10" onchange="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value" style="text-align:right;" readonly="readonly"/></td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Pengemudi : </td>
      <td bgcolor="#FFFFFF"><input type="hidden" name="pengemudi" id="pengemudi" />
          <input type="text" name="txtpengemudi" id="txtpengemudi" size="28" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=kontak&task=listsupir&open=window','name','825','450','yes');return false" />
          <?php if(strstr($_SESSION['akses'],"DD-2-1")) { ?>
          <a href="index.php?component=kontak&task=add&open=window" onclick="NewWindow(this.href,'name','1025','450','yes');return false"><img src="images/add_.png" hspace="2" border="0" style="position:absolute;" /></a>
          <?php } ?></td>
      <td align="right">&nbsp;</td>
      <td colspan="2" align="right">Uang Muka :</td>
      <td><input name="uangmuka" type="hidden" id="uangmuka" value="0" size="20" maxlength="10" onkeyup="javascript: if(this.value==''){ this.value='0'; } this.value=parseInt(this.value); 
	  var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;" readonly="readonly"/></td>
    </tr>
    
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">CSO Order:</td>
      <td valign="top" bgcolor="#FFFFFF"><label>
	    <input name="recipient" type="hidden" id="recipient" value="<?php echo $_SESSION['kontakid'];?>" />
		<input name="namarecipient" readonly="readonly" type="text" id="namarecipient" value="<?php echo $_SESSION['nama'];?>" />
      </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <th colspan="2" align="right" valign="top"> Grand Total :</th>
      <td valign="top">
	  <label id="divHargaGrandTotal">
        <input name="ntotal" type="text" id="ntotal" value="0" size="20" maxlength="10" onfocus="this.blur();" style="text-align:right;" />
        </label>
          <input name="a_kas" type="hidden" id="a_kas" value="<?php echo $row_gudang['a_kas'];?>" />
          <input name="a_kaskecil" type="hidden" id="a_kaskecil" value="<?php echo $row_gudang['a_kaskecil'];?>" />
        <input name="a_piu" type="hidden" id="a_piu" value="<?php echo $row_gudang['a_piu'];?>" />
        <input name="a_beb" type="hidden" id="a_beb" value="<?php echo $row_gudang['a_beb'];?>" />
        <input name="a_paj" type="hidden" id="a_paj" value="<?php echo $row_gudang['a_paj'];?>" />
        <input name="a_hpp" type="hidden" id="a_hpp" value="<?php echo $row_gudang['a_hpp'];?>" />
        <input name="a_pend" type="hidden" id="a_pend" value="<?php echo $row_gudang['a_pend'];?>" />
        <input name="a_potongan" type="hidden" id="a_potongan" value="<?php echo $row_gudang['a_potongan'];?>" />
        <input name="a_jasadriver" type="hidden" id="a_jasadriver" value="<?php echo $row_gudang['a_jasadriver'];?>" />
          <input name="a_insentifdriver" type="hidden" id="a_insentifdriver" value="<?php echo $row_gudang['a_insentifdriver'];?>" />
          <input name="a_bbm" type="hidden" id="a_bbm" value="<?php echo $row_gudang['a_bbm'];?>" />
          <input name="a_pph" type="hidden" id="a_pph" value="<?php echo $row_gudang['a_pph'];?>" />
          <input name="a_uangmuka" type="hidden" id="a_uangmuka" value="<?php echo $row_gudang['a_uangmuka'];?>" />
          <input name="a_deposit" type="hidden" id="a_deposit" value="<?php echo $row_gudang['a_deposit'];?>" />
          
          
          <input name="jenis" type="hidden" id="jenis" value="7" /></td>
    </tr>
    <tr>
		<td align="right" valign="top" bgcolor="#FFFFFF">EMAIL :</td>
		<td valign="top" bgcolor="#FFFFFF"><label>
	    <?php 
			$customer = mysql_query("SELECT email from gl_kontak WHERE nama = 'qtxt' ", $con_gl) or die(mysql_error());
			$row_customer = mysql_fetch_assoc($customer);
			
		?>
		<input name="txtemail" type="text" size="28" id="txtemail" value="" />
		</label></td>
	</tr>
	<tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Detail Transaksi :</td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <textarea name="transaksi" cols="35" rows="2" id="transaksi"></textarea>
      </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Keterangan :</td>
      <td valign="top"><div id="divKeterangan">
          <textarea name="keterangan" cols="40" rows="2" id="keterangan">Transaksi Sewa Kendaraan Retail</textarea>
          <input name="cid" type="hidden" id="cid" value=""/>
      </div></td>
    </tr>
    
    <tr>
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><input name="Save" type="submit" id="Save" value="Simpan Order" />
      <input name="Cancel" type="button" id="Cancel" value="Batal" onclick="javascript:history.go(-1);"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="3" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  </table>
</form>